Skip to content

[5.4] Fix BlockOperation with multiple execution blocks #3053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 27, 2021

Conversation

lxbndr
Copy link
Contributor

@lxbndr lxbndr commented Aug 18, 2021

This is cherry-picking of #2938, which I shamefully forgot to port from main.
Hope that 5.4.3 window is not closed yet.

Original description:

This is rebased version of #2497. Original request seems abandoned, but changes are useful. All credit goes to @dannliu.

Latest Foundation still has this issue: BlockOperation stores first execution block into the internal array along with a second execution block. As the result:

unexpected value is returned by executionBlocks
first block will be run twice.
Also @convention(block) specifier in executionBlocks makes dynamic cast crash on return. Looks like it could be safely removed.

Steps:
1. Create BlockOperation with an init block.
2. Add another one with addExecutionBlock.
3. Access the executionBlocks property, it contains 3 blocks.

Co-authored-by: Danny Liu <[email protected]>
@spevans
Copy link
Contributor

spevans commented Aug 18, 2021

@swift-ci test

@spevans
Copy link
Contributor

spevans commented Aug 18, 2021

@lxbndr I take it this went into main before 5.5 was branched off so it is in 5.5 ?

@spevans
Copy link
Contributor

spevans commented Aug 18, 2021

cc @drexin

@lxbndr
Copy link
Contributor Author

lxbndr commented Aug 18, 2021

@spevans Yes, it is present in 5.5 already.

@drexin
Copy link
Contributor

drexin commented Aug 18, 2021

@swift-ci test linux

@millenomi
Copy link
Contributor

millenomi commented Aug 20, 2021

cc @tomerd happy to merge to 5.4 if okay to merge.

@tomerd
Copy link

tomerd commented Aug 20, 2021

5.4.x merge window still open, so sgtm. cc @drexin which manages this release

@drexin drexin merged commit f44c458 into swiftlang:release/5.4 Aug 27, 2021
@lxbndr lxbndr deleted the unblock-block-operation-5.4 branch August 28, 2021 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants